<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>10.关于data写成函数这件事</title>
  </head>
  <body>
    <script type="text/javascript" >
      /* let data = {x:1}
      // 同事a
      console.log(data)
      // 同事b
      data.x = 9
      // 同事c
      console.log(data.x) */

      let data = function(){
        return {x:1}
      }

      // 同事a
      console.log(data())
      // 同事b
      let result = data()
      result.x = 9
      console.log(result)
      // 同事c
      let result2 = data()
      console.log(result2.x)

    </script>
  </body>
</html>